<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('blockIpList')}">已封IP列表</a></li>
        <li><a href="{:url('Operate/blockIpLog')}">封IP记录</a></li>
    </ul>
    <form class="search_form" method="get" action="{:url('blockIpList')}">
        <div class="well form-inline margin-top-20">
            IP：
            <input type="text" class="form-control" name="ip" style="width: 150px;" value="{:input('request.ip/s','')}" placeholder="输入IP地址">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-warning doForbidLock" data-url="{:url('PlayerManage/forbidIp')}" href="javascript:void(0);">封禁此IP</a>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="center">IP</th>
                <th align="center">IP地址</th>
                <th align="center">操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td>{$vo.value}</td>
                    <td>{:getIpFromAddress($vo['value'])}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="javascript:doForbidLock('unlock_ip','{$vo.value}','{:url('PlayerManage/forbidIp')}');">解IP</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<include file="public@footer" />
<script type="text/javascript">
    $(".doForbidLock").on("click",function(){
        var ip = $("input[name=ip]").val();
        if(ip == ''){
            dialogAlert("face-sad","ip不能为空");
            return ;
        }
        doForbidLock("lock_ip",ip,$(this).data("url"));
    });
</script>